home *** CD-ROM | disk | FTP | other *** search
- Path: news.spies.com!usenet
- From: Erik Max Francis <max@alcyone.com>
- Newsgroups: comp.lang.c
- Subject: Re: [Q] Reading Text From File
- Date: Fri, 29 Mar 1996 14:42:12 -0800
- Organization: Alcyone Systems
- Message-ID: <315C6744.32A724CC@alcyone.com>
- References: <4jf6qa$ng@preeda.internex.net.au>
- NNTP-Posting-Host: newton.alcyone.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i486)
-
- Quenten Barber wrote:
-
- > I run a small 1 line BBS and am looking to make my own 'Last Callers'
- > door thing, So I looked up the Structure for Remote Access's files and
- > found it was all done in Pascal.... so I've tried to convert it to C
- > and i eventually go it to read in the files fine, untill I put a different
- > "Lastcall.bbs" file in there then it missed bits and the names wouldn't come
- > out right, I presume that there isn't any inconsistancys (excuse my spelling)
- > with RA as I looked at the files with a Hex Editor and found that all of
- > the strings started at the same offset, so why dosn't my program read them
- > in the same way ??
-
- Likely your problem is that C packs structures differently than Pascal packs
- records. Basically there's no reliable (meaaning portable) way to get around
- this. What you should do is read the Pascal record size in as a block and then
- pick out the bits and pieces that you want individually. (Also, strings will
- be Pascal strings, not C strings.)
-
- --
- Erik Max Francis &tSftDotIotE && http://www.alcyone.com/max && max@alcyone.com
- San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
- H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
- Omnia quia sunt, lumina sunt. && Dominion, GIGO, GOOGOL, Omega, Psi, Strategem
- "Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_
-